import Taro, { Component,redirectTo } from '@tarojs/taro'
import { View, Text, Image,} from '@tarojs/components'
import { connect } from '@tarojs/redux'
import { imgUrl } from '../../config'

import './htXq.scss'

@connect(({ counter }) => ({
  counter
}),)

class HtXq extends Component {

  // config = {
  //   navigationBarTitleText: '首页'
  // }
  constructor (props) {
    super(props)
    this.state = { 
      value:"<"
     }
  }

  componentWillMount(){
  }
  componentDidMount(){

  }
  photo(){
    redirectTo({
      url: '/pages/photo/photo'
    })
  }
  back(){
    redirectTo({
      url:'/pages/index/index'
    })
  }
  cont(){
    redirectTo({
      url: '/pages/tzDetail/tzDetail'
    })
  }
  render () {
    return (
   
            <View className='index'>
            <View className='head'>
              <Text className='close' onClick={this.back}>{this.state.value}</Text>
              <Text className='name'>话题详情</Text>
            </View>
            <View className='top'>
                <View className='htName'># 欧尚cos1°</View>
                <View className='all'> 
                  <Text className='text1'>参与：2365</Text>
                  <Text className='text2'>帖子：2365</Text>
                  <Text className='text3'>查看：2365</Text>
                </View>
            </View>
            <View className='contAll'>
            {this.props.counter.list.map((item,index) =>
              <View className='cont' key={index} onClick={this.cont}>
              <Image src={item.pic} className='pic1' />
              <Image src={item.jh ? item.jh : ''} className='jh' />
              <View className='text'>
                <Text className='text1'>{item.tit1}</Text>
                <Text className='text2'>{item.tit2}</Text>
                <View className='tou'>
                  <Image src={item.tou} className='touPic' />
                  <Text className='name'>{item.name}</Text>
                  <Image src={item.zan} className='zan' />
                  <Text className='shu'>{item.shu}</Text>
                </View>
              </View>
            </View>         
            )}
            </View>
            <Image src={`${imgUrl}/fbht.png`} onClick={this.photo} className='fbht' />
            </View>
      // </ScrollView>

    )
  }
}

export default HtXq
